package com.vedana.bankmobile.jaxrs;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import com.vedana.bankmobile.services.BankMobileService;
import com.vedana.bankmobile.services.BankMobileServiceImpl;
import com.vedana.bankmobile.shared.Operation;

@Path("/operations")
public class BankMobileOperationsWS {
	private BankMobileService service;

	@SuppressWarnings("unused")
	@PostConstruct
	private void init() {
		this.service = new BankMobileServiceImpl();
	}
	
	@GET    
	@Produces("application/json")    
	public List<Operation> listOperations(@QueryParam("accountId")long accountId) {    
	  List<Operation> operations = service.getAllOperations(accountId);  
	  return operations;  
	 }    	
}
